Super simple header node.¶
Name | Children | Inherits |
---|---|---|
MkNode mknodes.basenodes.mknode Base class for everything which can be expressed as Markup. |
graph TD
93860742937664["mkheader.MkHeader"]
93860744073616["mknode.MkNode"]
93860744080896["node.Node"]
140589822947552["builtins.object"]
93860744073616 --> 93860742937664
93860744080896 --> 93860744073616
140589822947552 --> 93860744080896
/home/runner/work/mknodes/mknodes/mknodes/basenodes/mkheader/metadata.toml
[metadata]
icon = "mdi:format-header-pound"
name = "MkHeader"
group = "base"
[examples.regular]
title = "Regular"
jinja = """
{{ "Header with level 2" | MkHeader(level=2) }}
"""
[examples.header_levels]
title = "Header levels"
jinja = """
{% for i in range(1, 7) %}
{{ ("Header level " ~ i) | MkHeader(level=i) }}
{% endfor %}
"""
[output.markdown]
template = """
{{ "#" * node.level }} {{ node.text }}{% if node.exclude_from_search %} { data-search-exclude }{% endif %}
"""
# [output.html]
# template = """
# <h{{ node.level }}>{{ node.text }}</h{{ node.level }}>
# """
[output.rst]
template = """
{% set line = {1: '#' , 2: '*' , 3: '=' , 4: '-' , 5: '^' , 6: '"' }[node.level] * (node.text | length) %}
{{ line }}
{{ node.text }}
{{ line }}
"""